<%@ page language="java" contentType="text/html; charset=utf-8" isErrorPage="true"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<base href="<%=basePath %>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>出现错误</title>
<link type="text/css" rel="stylesheet" href="images/error.css">
</head>
<body>
<div class="error">
	<div class="error_info">
		<div class="main_info">
			<table>
				<tr>
					<td><img src="images/error_ico.gif" align="absmiddle"></td>
					<td>
						<%
							String code=request.getAttribute("javax.servlet.error.status_code")==null?"":request.getAttribute("javax.servlet.error.status_code").toString();
							if(!code.matches("")){
								if(code.matches("400"))
									out.println("页面请求错误！<br>");
								else if(code.matches("404"))
									out.println("页面不存在！<br>");
								else if(code.matches("500")){
									out.println("内部服务器错误：");
									String exceptionType=request.getAttribute("javax.servlet.error.exception_type")==null?"":request.getAttribute("javax.servlet.error.exception_type").toString();
									if(exceptionType.indexOf("CannotCreateTransactionException")>-1)
										out.println("<span style='color:red;'>数据库链接错误！</span>");
									else if(exceptionType.indexOf("HibernateQueryException")>-1)
										out.println("<span style='color:red;'>查询出错！</span>");
									else
										out.println("<span style='color:red;'>其它错误！</span>");
									out.println("<br><span style='font-size:12px;font-weight:normal;'>详细信息："+request.getAttribute("javax.servlet.error.message")+"</span><br>");
								}
							}
							else{
								String errorinfo=request.getParameter("errorinfo");
								if(errorinfo!=null){
									out.println("内部服务器错误：");
									if(errorinfo.indexOf("CannotCreateTransactionException")>-1)
										out.println("<span style='color:red;'>数据库链接错误！</span>");
									else if(errorinfo.indexOf("HibernateQueryException")>-1)
										out.println("<span style='color:red;'>查询出错！</span>");
									else
										out.println("<span style='color:red;'>其它错误！</span>");
									out.println("<br><span style='font-size:12px;font-weight:normal;'>详细信息："+errorinfo+"</span><br>");
								}
							}
						%>
					</td>
				</tr>
			</table>
		</div>
		<div class="help_info">
			<span>请尝试以下几种方式解决问题：</span>
			<ul>
				<li>检查您正在浏览的网址是否正确</li>
				<li><a href="#" onClick="Javascript:history.go(-1);">返回</a></li>
				<li>如果您是通过点击本站上某一处链接到达了这里的，请随时与系统管理员取得联系，并且我们为此给您带来的不便表示歉意。</li>
			</ul>
		</div>
	</div>
</div>
</body>
</html>